#!/bin/sh

# Generate a random API key
API_KEY=$(LC_ALL=C tr -dc 'A-Za-z0-9' </dev/urandom | head -c 48 ; echo)
sed -i "s/\$API_KEY/$API_KEY/g" /etc/typesense/typesense-server.ini

systemctl enable typesense-server
systemctl daemon-reload
systemctl start typesense-server
